<?php
/**
 * FeedbackForm class.
 * FeedbackForm is the data structure for keeping merchant feedback data.
 * It is used by the 'form' of 'FeedbackController'.
 * 
 * LBB Solutions Oy 版权所有 © 2013
 */
class FeedbackForm extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return ShopProfile the static model class
	 */
	public static function model($className = __CLASS__) {
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName() {
		return 'tbl_merchant_feedback';
	}

	/**
	 * Declares the validation rules.
	 */
	public function rules() {
		return array(
			// fields are required
			array('email', 'required', 'message'=>BUtils::T('cannot_be_blank_msg')),
			array('content', 'required', 'message'=>BUtils::T('feedback_enter_empty_error_msg')),
			array('email', 'email', 'allowEmpty'=>false, 'checkMX'=>true, 'message'=>BUtils::T('email_address_error_msg')),
			array('email, content', 'safe'),
		);
	}

	/**
	 * Declares attribute labels.
	 */
	public function attributeLabels() {
		return array(
			'email' => BUtils::T('email_address_lbl'),
		);
	}
}
